﻿using System;

namespace ZOIL.DataModel
{
    public static class DatabaseCollection
    {
        public static bool IsCollectionSet
        {
            get { return _collection != null; }
        }

        #region Collection

        private static IPersistableCollection _collection;

        public static IPersistableCollection Collection
        {
            get
            {
                if (!IsCollectionSet)
                {
                    throw new InvalidOperationException("No Collection set!");
                }
                return _collection;
            }
            set { _collection = value; }
        }

        #endregion
    }
}